/*
 * Email Notify
 * Author: Antonio Nastasi
 * Email: sifcenter (at) gmail.it
 * Version: 0.2
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#ifndef CONFIGDIALOG_H
#define CONFIGDIALOG_H

#include <KConfig>
#include <KConfigGroup>
#include <QComboBox>
#include <QLineEdit>
#include <QSpinBox>
#include <QCheckBox>
#include <Phonon/MediaObject>
#include <KPageDialog>

class ConfigDialog : public KPageDialog {
    Q_OBJECT
    public:
	ConfigDialog();
	~ConfigDialog();
	void show();
	
    private:	
	KConfig *config;
	KConfigGroup *generalGroup;
	/* entries for config */
	QLineEdit *server_text;
	QSpinBox *port_spin;
	QComboBox *protocol_combo;
	QCheckBox *ssl_check;
	QLineEdit *login_text;
	QLineEdit *pass_text;	
	
	QComboBox *sound_combo;
	QSpinBox *interval_spin;
	QPushButton *play_button;
	// For test sound
	Phonon::MediaObject *media;
	
	void loadConfig();
	
   private slots:       
	void saveConfig();
	void playSound();
	void soundFinished();
	void sslStateChanged(int);
	void protocolIndexChanged(QString);
	void hide();
};
#endif
